
// 
//  function executed on death of a hostage.  If all hostages are dead,
// Then end game.
//
HS_Hostage_Death_Check= {

	diag_log "Hostage Death Check";

	// Check for any Hostages still alive, who are actually assigned in game too..
	if ((!isNil "HOSTAGE1") and (alive HOSTAGE1)) exitWith {};
	if ((!isNil "HOSTAGE2") and (alive HOSTAGE2)) exitWith {};

	diag_log "Mission needs to end, all Hostages dead.";
	// If we're still here, then all hostages are dead.
	// Let's just wait a moment...
	sleep 15;

	ENDGAME= "CIV_DIES"; 
	publicVariable "ENDGAME";
	// Because this event is running on a client, we also need to call the function ourselves...
	// as publicVariable isn't sent to ourselves.
	["CIV_DIES"] call HS_End_Mission;
};
